package com.zzx.boot.utils;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class R<T> {

    private T data;
    private String msg;
    private Integer code;

    public R(){

    }

    public static <T>R<T> success(T data){
        return new R<>(data,"请求成功",200);
    }

    public static <T>R<T> error(String msg,Integer code){
        return new R<>(null,msg,code);
    }

}
